﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;
using RestFulService.pad;

/************************************************************************************
* Autor：xuliangxing
* Email：907562392@qq.com
* WeChart：xuliangxing
* Version：V1.0.0.0
* CreateTime：2018/4/8 13:36:40
* Description：
* Company：
* Copyright © 2018  All Rights Reserved
************************************************************************************/
namespace RestFulService
{
    /// <summary>
    /// 定义两种方法，1、GetScore方法：通过GET请求传入name，返回对应的成绩；2、GetInfo方法：通过POST请求，传入Info对象，查找对应的User并返回给客户端
    /// </summary>
    [ServiceContract(Name = "PersonInfoQueryServices")]
    public interface IPersonInfoQuery
    {
        /// <summary>
        /// 说明：
        /// WebGet默认请求是GET方式
        /// UriTemplate(URL Routing)的参数名name必须要方法的参数名必须一致（不区分大小写）
        /// RequestFormat规定客户端必须是什么数据格式请求的（JSon或者XML），不设置默认为XML
        /// ResponseFormat规定服务端返回给客户端是以是什么数据格返回的（JSon或者XML）
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(UriTemplate = "PersonInfoQuery/{name}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        User GetScore(string name);

        //测试跨域
        //https://learn.microsoft.com/zh-cn/dotnet/api/system.servicemodel.webhttpbinding?view=netframework-4.8.1
        //[OperationContract]
        [WebGet(UriTemplate = "menu/getcat", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        User GetKScore();

        /// <summary>
        /// 说明：
        /// WebInvoke请求方式有POST、PUT、DELETE等，所以需要明确指定Method是哪种请求的。
        /// 注意：POST情况下，UriTemplate(URL Routing)一般是没有参数（和上面GET的UriTemplate不一样，因为POST参数都通过消息体传送）
        /// RequestFormat规定客户端必须是什么数据格式请求的（JSon或者XML），不设置默认为XML
        /// ResponseFormat规定服务端返回给客户端是以是什么数据格返回的（JSon或者XML）
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "PersonInfoQuery/Info", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        User GetInfo(Info info);

        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "login", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        Login doLogin(LoginInfo info);

        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "getCashierByStoreId", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        cashierList dogetCashierByStoreId(StoreInfo info);

        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "*", UriTemplate = "getMenuByStoreId", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        MenuItem dogetMenuByStoreId(StoreInfo info);

        /// </summary>
        /// <param name="info">oco-pos-->扫描桌台</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "*", UriTemplate = "postablet/order/dogetOrder", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        CocoOrdList dogetOrdListByStoreId(StoreInfo info);

        /// </summary>
        /// <param name="info">oco-pos-->订单上传</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "*", UriTemplate = "postablet/order/docreateOrder", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        CocoInfo doSendCoCoOrder(CocoOrder info);

        /// </summary>
        /// <param name="info">交易上传</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "createOrder", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        OrdDataInfo docreateOrder(OrdData info);

        /// </summary>
        /// <param name="info">支付上传</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "payFace", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        OrdPayInfo doPayFace(OrdPay info);

        /// </summary>
        /// <param name="info">订单查询</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "getOrderInfoList", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        TranData dogetOrderInfoList(OrdQry info);

        /// </summary>
        /// <param name="info">订单退货</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "payRefund", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        BACKDATA dopayRefund(OrdReturn info);

        /// </summary>
        /// <param name="info">外卖订单</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "getWMOrder", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        WMOrd dogetWMOrder(WMOrdQry info);

        /// </summary>
        /// <param name="info">会员登陆</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "doMemberLogin", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        MemberInfo doMemberLogin(MemberQry info);

        /// </summary>
        /// <param name="info">会员礼券列表</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "doGetTicketList", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        TICKETLIST doGetTicketList(MemberQry info);

        /// </summary>
        /// <param name="info">会员礼券列表</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "doGetTicketInfo", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        TICKETINFO doGetTicketInfo(MemberQry info);

        /// </summary>
        /// <param name="info">会员注册</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "doRegMember", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        BACKDATA doRegMember(NewMember info);

        /// </summary>
        /// <param name="info">获取兑换优惠券列表</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "doGetExchangeList", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        ExchangeList doGetExchangeList(MemberQry info);

        /// </summary>
        /// <param name="info">提交兑换优惠券列表</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "doSetExchangeList", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        BACKDATA doSetExchangeList(ExchangeTicket info);

        //2022.05.10 add
        /// </summary>
        /// <param name="info">200.检查当前是否已开班</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "doCheckShift", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        ShiftReturn doCheckShift(ShiftInfo info);

        /// </summary>
        /// <param name="info">201.开班</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "doOpenShift", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        BACKDATA doOpenShift(ShiftBiz info);

        /// </summary>
        /// <param name="info">202.交班</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "doCloseShift", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        BACKDATA doCloseShift(ShiftBiz info);

        /// </summary>
        /// <param name="info">203.借零</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "doPutMoney", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        BACKDATA doPutMoney(ShiftBiz info);

        /// </summary>
        /// <param name="info">204.投库</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "doGutMoney", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        BACKDATA doGutMoney(ShiftBiz info);

        /// </summary>
        /// <param name="info">205.班别查询</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "doQueryShift", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        ShiftList doQueryShift(ShiftQuery info);

        /// </summary>
        /// <param name="info">206.日结</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "doEndDay", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        BACKDATA doEndDay(endday info);

        /// </summary>
        /// <param name="info">207.日结查询</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "doQueryDay", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        endList doQueryDay(endday info);

        /// </summary>
        /// <param name="info">301.服饰-商品分类</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "dogetCatList", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        padclass dogetCatList(padversion info);

        /// </summary>
        /// <param name="info">302.服饰-商品资料</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "dogetPluList", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        padplu dogetPluList(padversion info);

        /// </summary>
        /// <param name="info">303.服饰-营业员资料</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "dogetSaleManList", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        padman dogetSaleManList(padversion info);

        /// </summary>
        /// <param name="info">304.服饰-支付资料</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "dogetPayList", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        padpayment dogetPayList(padversion info);

        /// </summary>
        /// <param name="info">305.服饰-他店库存</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "getPluInvList", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        padinvlist getPluInvList(padsku info);

        /// </summary>
        /// <param name="info">306.服饰-订单查询</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "getOrdList", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        padorddata getOrdList(padordqry info);

        /// </summary>
        /// <param name="info">307.服饰-外卖订单</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "getShopOrdList", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        padshopord getShopOrdList(WMOrdQry info);

        /// </summary>
        /// <param name="info">308.服饰-退货上传</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "setreturn", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        BACKDATA setreturn(padreturn info);

        /// </summary>
        /// <param name="info">309.服饰-库存查询</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "getinvlist", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        padinvdata getinvlist(padinvqry info);

        /// </summary>
        /// <param name="info">310.服饰-业绩报表</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "gettimesale", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        pdatimesale gettimesale(pdareport info);

        /// </summary>
        /// <param name="info">311.服饰-营业员提成</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "getmanamt", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        padmansale getmanamt(pdareport info);

        /// </summary>
        /// <param name="info">312.服饰-销售排行榜</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "getplutime", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        padplusale getplutime(pdareport info);

        /// </summary>
        /// <param name="info">313.服饰-查询商品库存</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "doqueryiteminv", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        ItemInv doqueryiteminv(qryiteminv info);

        /// </summary>
        /// <param name="info">901.会员登陆</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "pos/doMemberLogin", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        JAVAMemberInfo doJAVAMemberLogin(JAVAMemberQry info);

        /// </summary>
        /// <param name="info">902.获取会员礼券号码</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "pos/doGetTicketInfo", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        JAVATICKETINFO doJAVAGetTicketInfo(JAVAMemberQry info);

        ///扫描点餐+订单下推
        /// </summary>
        /// <param name="info">扫描点餐</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "desk/ScanOrder", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        OrdDataInfo doSetOrder(ScanOrder info);

        /// </summary>
        /// <param name="info">获取名牌</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "/Auth/Client", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        deskToken dogetToken(deskPara info);

        //[OperationContract]
        [WebGet(UriTemplate = "Order", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        deskOrder doScanOrdList();

        [OperationContract]
        [WebInvoke(Method = "PUT", UriTemplate = "/Order/receiving/{channelsheetno}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        deskReturn doScanGetOrd(string channelsheetno);

        // c#-pos
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "/v20/api/cashier/masterVersionCheck", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        s_plucheck masterVersionCheck(c_plucheck info);

        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "/v20/api/coco/postablet/order/createOrder", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        s_postran createOrder(c_postran info);

    }
}
